Content serving systems exist that receive requests for content from clients and service such requests by obtaining requested content from files stored on a file system. One example of such a content serving system is a disk caching system. A disk caching system stores frequently-accessed content obtained from a remote content source (or from another disk caching system) in a file system so that it can service requests for such frequently-accessed content directly therefrom. However, this is only one example, and there are numerous other types of content serving systems that service client content requests by obtaining data from files stored in a file system.
To obtain data from a file stored in the file system, such a content serving system must request that the file system open the file. Opening a file is an operation that carries considerable overhead in terms of memory, disk input/output (I/O) and CPU cycles. If the number of files that must be opened to service content requests is very large, then the associated overhead may adversely impact system performance consequently, some content serving systems are configured to keep files open even after they have been accessed to service a content request. In this way, subsequent requests for the same content can be serviced without re-opening the files and incurring the associated overhead. These systems often utilize a file handle cache to store file handles to currently-opened files.
However, if too many file handles are kept open concurrently, other problems may arise. For example, in certain massive disk caching scenarios, thousands of handles to files are kept open. This causes high memory consumption, especially when the file system keeps the accessed file content cached (i.e., resident in system memory). To avoid consuming all or substantially all of the system memory, it is important to accurately identify and evict file handles from the file handle cache that are not so frequently used. Furthermore, any such eviction process must be carried out in a way that only minimally impedes the ability of the content serving system to access the file handle cache to service content requests, thereby avoiding bottlenecks.